// locales/i18n.ts
import { createI18n } from 'vue-i18n'

// element plus 自带国际化
import enLocale from 'element-plus/es/locale/lang/en'
import zhcnLocale from 'element-plus/es/locale/lang/zh-cn'

const messages = {
  en: enLocale,
  zhCn: zhcnLocale
}

const i18n = createI18n({
  legacy: false,
  silentTranslationWarn: true,
  missingWarn: false,
  silentFallbackWarn: true,
  fallbackWarn: false,
  fallbackLocale: zhcnLocale.name,
  messages,
  locale: 'zhCn'
})

export default i18n
